package com.gexiaobao.pigeon.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.OutComeList
import com.gexiaobao.pigeon.databinding.ItemAboutPassOutComeBinding

/**
 * @Author      : hxw
 * @Date        : 2024/7/19 15:20
 * @Describe    :
 */
class AdapterOutcome(data: ArrayList<OutComeList>) : BaseQuickAdapter<OutComeList, DataBindBaseViewHolder>(R.layout.item_about_pass_out_come, data) {
    override fun convert(holder: DataBindBaseViewHolder, item: OutComeList) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemAboutPassOutComeBinding
        binding.data = item
        binding.executePendingBindings()//防止列表抖动

        val sb = StringBuffer()
        if (item.signs.isNotEmpty()) {
            item.signs.forEach {
                sb.append("$it / ")
            }
        }

        holder.setText(R.id.tvItemDisburseGroupName, sb.toString().trim().substring(0, sb.toString().trim().length - 1))
    }
}